const path  = require('path')
const { defineConfig } = require('@vue/cli-service')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = defineConfig({
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.join(__dirname, 'src')
      }
    },
    plugins: [
      new MonacoWebpackPlugin({
        // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
        languages: ['html', 'css', 'json', 'typescript', 'javascript', 'sql']
      })
    ]
  },
  devServer: {
    port: 8888,
    client: {
      //当出现编译错误或警告时，在浏览器中是否显示全屏覆盖。  示例为只显示错误信息
      overlay: false
    },
    proxy: {
      '/dev': {
        target: process.env.VUE_APP_SERVER_URL,
        changeOrigin: true,
        pathRewrite: {
          '^/dev': ''
        }
      }
    },
    allowedHosts: 'all'
  },
  transpileDependencies: true,
  lintOnSave: false
})
